//
//  XiaoxiTongzhi_vc.m
//  ainkjj
//
//  Created by MAX on 2020/4/17.
//  Copyright © 2020 zhiyiLiu. All rights reserved.
//

#import "XiaoxiTongzhi_vc.h"

@interface XiaoxiTongzhi_vc ()
@property (nonatomic, strong)NSMutableArray *titlesArr;
@property (nonatomic, strong)NSMutableArray *classNamesArr;
@end

@implementation XiaoxiTongzhi_vc
- (instancetype)init

{
    self = [super init];
    if (self) {
        self.progressWidth = 40;
        self.titleColorSelected = themeColor;
        self.titleColorNormal = UIColor.darkGrayColor;
        self.titleSizeNormal = 17;
        self.titleSizeSelected = 20;
        [self setMenuViewStyle:WMMenuViewStyleLine];
    }
    
    return self;
}
- (void)viewDidLoad{
    [super viewDidLoad];
    self.title = @"消息通知";
    

}

- (NSMutableArray *)titlesArr{
    if(_titlesArr == nil)
    { _titlesArr = @[@"消息", @"通知"].mutableCopy;
    }
    
    return _titlesArr;
}
- (NSMutableArray *)classNamesArr{
    if(_classNamesArr == nil)
    {_classNamesArr = @[ @"Xiaoxi_vc", @"Tongzhi_vc"].mutableCopy;
    }
    
    return _classNamesArr;
}

#pragma mark - WMPageController DataSource
- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController {
    return self.titlesArr.count;
}

- (NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index {
    return self.titlesArr[index];
}

- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index {
    UIViewController *vc = nil;
    vc = [NSClassFromString(self.classNamesArr[index]) new];

    return vc;
}
-(CGRect)pageController:(WMPageController *)pageController preferredFrameForMenuView:(WMMenuView *)menuView{
    CGFloat originY =  CGRectGetMaxY(self.navigationController.navigationBar.frame);

    return  CGRectMake(0,  originY, [UIScreen mainScreen].bounds.size.width, 50);
}
- (CGRect)pageController:(WMPageController *)pageController preferredFrameForContentView:(WMScrollView *)contentView{
    CGFloat originY = CGRectGetMaxY([self pageController:pageController preferredFrameForMenuView:self.menuView]);

    return  CGRectMake(0,  originY, self.view.bounds.size.width,self.view.bounds.size.height - originY);
    
}

@end
